<definitions
  xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
  xmlns:camunda="http://camunda.org/schema/1.0/bpmn"
  targetNamespace="Examples">

  <process id="process" isExecutable="true">
    <startEvent id="start" />
    <userTask id="task1">
      <extensionElements>
        <camunda:taskListener event="create">
          <camunda:script scriptFormat="groovy">
            task.setVariable(task.eventName, true)
          </camunda:script>
        </camunda:taskListener>
        <camunda:taskListener event="assignment">
          <camunda:script scriptFormat="groovy">
            task.setVariable(task.eventName, true)
          </camunda:script>
        </camunda:taskListener>
        <camunda:taskListener event="complete">
          <camunda:script scriptFormat="groovy">
            task.setVariable(task.eventName, true)
          </camunda:script>
        </camunda:taskListener>
      </extensionElements>
    </userTask>
    <userTask id="task2">
      <extensionElements>
        <camunda:taskListener event="delete">
          <camunda:script scriptFormat="groovy">
            task.setVariable(task.eventName, true)
          </camunda:script>
        </camunda:taskListener>
      </extensionElements>
    </userTask>
    <endEvent id="end" />
    <sequenceFlow sourceRef="start" targetRef="task1" />
    <sequenceFlow sourceRef="task1" targetRef="task2" />
    <sequenceFlow sourceRef="task2" targetRef="end" />
  </process>
</definitions>
